package com.xm.xmwa1706090.service.service.impl;

import io.netty.channel.ChannelHandlerContext;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Loysen
 * @company 杭州新苗网络科技有限公司
 * @date 2017/6/30  11:04
 * @
 */
public class GatewayService {

    private static Map<String, ChannelHandlerContext> map = new ConcurrentHashMap<>();

    public static void addGatewayChannel(String id, ChannelHandlerContext gateway_channel){
        map.put(id, gateway_channel);
    }

    public static Map<String, ChannelHandlerContext> getChannels(){
        return map;
    }

    public static ChannelHandlerContext getGatewayChannel(String id){
        return map.get(id);
    }

    public static void removeGatewayChannel(String id){
        map.remove(id);
    }
}
